//
//  WKWebBottomToolBar.swift
//  CooperSwift
//
//  Created by 计海峰 on 2020/3/7.
//  Copyright © 2020 CooperSwift. All rights reserved.
//

import UIKit

class WKWebBottomToolBar: UIView {
    
    lazy var backBT: UIButton = {
        var bt = UIButton.init()
        bt.setBackgroundImage(UIImage(named: "arrow-left", in: Bundle.frameworkBundle(), compatibleWith: nil), for: .normal)
        return bt
    }()
    
    lazy var forwardBT: UIButton = {
        var bt = UIButton.init()
        bt.setBackgroundImage(UIImage(named: "arrow-right", in: Bundle.frameworkBundle(), compatibleWith: nil), for: .normal)
        return bt
    }()
    
    lazy var centerBT: UIButton = {
        var bt = UIButton.init()
        bt.setBackgroundImage(UIImage(named: "refresh-center", in: Bundle.frameworkBundle(), compatibleWith: nil), for: .normal)
        return bt
    }()
    
    lazy var lineView: UIView = {
        var line = UIView.init()
        line.backgroundColor = .init(hex: "f2f3f4")
        return line
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.configSubview()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func configSubview() {
        addSubviews([backBT, forwardBT, centerBT, lineView])

        centerBT.snp.makeConstraints { (make) in
            make.center.equalToSuperview()
        }
        backBT.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview().offset(0);
            make.centerX.equalToSuperview().offset(-100);
        }
        forwardBT.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview().offset(0);
            make.centerX.equalToSuperview().offset(100);
        }
        lineView.snp.makeConstraints { (make) in
            make.top.left.right.equalToSuperview()
            make.height.equalTo(0.5)
        }
    }
    
}
